package com.recharge.core.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author Reagan
 * @since 2020-09-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("business_order")
public class OrderEntity implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 交易ID
     */
    @TableField("transaction_id")
    private String transactionId;

    /**
     * 商品ID
     */
    @TableField("goods_id")
    private String goodsId;


    /**
     * 供应商ID
     */
    @TableField("provider_id")
    private String providerId;


    /**
     * 下游商户信息
     */
    @TableField("merchant_id")
    private String merchantId;

    /**
     * 订单号
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 供应商号
     */
    @TableField("provider_no")
    private String providerNo;


    @TableField("merchant_no")
    private String merchantNo;

    /**
     * 交易号
     */
    @TableField("transaction_no")
    private String transactionNo;


    /**
     * 退款号
     */
    @TableField("refund_no")
    private String refundNo;

    /**
     * 商品号
     */
    @TableField("goods_no")
    private Integer goodsNo;

    /**
     * 归属地省
     */
    @TableField("province_name")
    private String provinceName;


    /**
     * 充值凭证号
     */
    @TableField("voucher_no")
    private String voucherNo;

    /**
     * 归属地城市
     */
    @TableField("city_name")
    private String cityName;

    /**
     * 供应商名称
     */
    @TableField("provider_name")
    private String providerName;

    /**
     * 下游商家名
     */
    @TableField("merchant_name")
    private String merchantName;

    /**
     * 充值号码
     */
    @TableField("recharge_number")
    private String rechargeNumber;


    /**
     * 1 移动2 电信3 联通

     */
    @TableField("service_provider")
    private Integer serviceProvider;

    /**
     * 产品标题
     */
    @TableField("title")
    private String title;

    /**
     * 价格
     */
    @TableField("amount")
    private Long amount;

    /**
     * 成本折扣
     */
    @TableField("cost_discount")
    private Float costDiscount;

    /**
     * 销售折扣
     */
    @TableField("agent_discount")
    private Float agentDiscount;

    /**
     * 商品数量
     */
    @TableField("goods_quantity")
    private Integer goodsQuantity;

    /**
     * 供货数量
     */
    @TableField("provide_quartity")
    private Integer provideQuartity;

    /**
     * 处理时长
     */
    @TableField("process_time")
    private Long processTime;

    @TableField("create_date")
    private Date createDate;

    @TableField("modifi_date")
    private Date modifiDate;

    /**
     * 供应商流水号
     */
    @TableField("provider_serial_number")
    private String providerSerialNumber;

    /**
     * 供应回调信息
     */
    @TableField("provider_callback_info")
    private String providerCallbackInfo;

    /**
     * 共应商回掉状态
     */
    @TableField("provider_callback_status")
    private Integer providerCallbackStatus;

    /**
     * 商家流水
     */
    @TableField("merchant_serial_number")
    private String merchantSerialNumber;

    /**
     * 商家回调信息
     */
    @TableField("merchant_callback_info")
    private String merchantCallbackInfo;

    /**
     * 商家回调状态
     */
    @TableField("merchant_callback_status")
    private Integer merchantCallbackStatus;


    @TableField("callback")
    private String callback;

    /**
     * 1.创建 2.处理中 3.成功 4.失败 5.充值中 6.异常 7.未确认
     */
    @TableField("status")
    private Integer status;


    @TableField("retry_status")
    private Integer retryStatus;

    /**
     * -1 删除 1 有效
     */
    @TableField("is_delete")
    private Integer isDelete;

    /**
     * 节点名称
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer nodeName;

    @TableField(exist = false)
    private Integer handleNumber;
    @TableField(exist = false)
    private Integer processNumber;
    @TableField(exist = false)
    private Integer successNumber;
    @TableField(exist = false)
    private Integer failNumber;
    @TableField(exist = false)
    private Integer unconfirmedNumber;
    @TableField(exist = false)
    private Integer totalNumber;
    @TableField(exist = false)
    private Double sale;
    @TableField(exist = false)
    private Double cost;

    @Override
    public String toString() {
        return "OrderEntity{" +
                "id='" + id + '\'' +
                ", transactionId='" + transactionId + '\'' +
                ", goodsId='" + goodsId + '\'' +
                ", providerId='" + providerId + '\'' +
                ", merchantId='" + merchantId + '\'' +
                ", orderNo='" + orderNo + '\'' +
                ", providerNo='" + providerNo + '\'' +
                ", merchantNo='" + merchantNo + '\'' +
                ", transactionNo='" + transactionNo + '\'' +
                ", refundNo='" + refundNo + '\'' +
                ", goodsNo=" + goodsNo +
                ", providerName='" + providerName + '\'' +
                ", merchantName='" + merchantName + '\'' +
                ", rechargeNumber='" + rechargeNumber + '\'' +
                ", title='" + title + '\'' +
                ", amount=" + amount +
                ", costDiscount=" + costDiscount +
                ", agentDiscount=" + agentDiscount +
                ", goodsQuantity=" + goodsQuantity +
                ", provideQuartity=" + provideQuartity +
                ", processTime=" + processTime +
                ", createDate=" + createDate +
                ", modifiDate=" + modifiDate +
                ", providerSerialNumber='" + providerSerialNumber + '\'' +
                ", providerCallbackInfo='" + providerCallbackInfo + '\'' +
                ", providerCallbackStatus=" + providerCallbackStatus +
                ", merchantSerialNumber='" + merchantSerialNumber + '\'' +
                ", merchantCallbackInfo='" + merchantCallbackInfo + '\'' +
                ", merchantCallbackStatus=" + merchantCallbackStatus +
                ", status=" + status +
                ", isDelete=" + isDelete +
                '}';
    }
}
